﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="VoteResult.aspx.cs" Inherits="Pages_VoteResult" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../Styles/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script src="../scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var i = 0;
            $("table.tbvote div[class=bar]").each(function () {
                if (i == 0) {
                    var width = parseInt($(this).html());
                    $(this).html("");
                    $(this).addClass($(self).attr("class")).css({
                        "height": "20px",
                        "width": width + "%",
                        "display": "block",
                        "float": "left",
                        "background-color": "#ff3300"
                    })
                }
                if (i == 1) {
                    var width = parseInt($(this).html());
                    $(this).html("");
                    $(this).addClass($(self).attr("class")).css({
                        "height": "20px",
                        "width": width + "%",
                        "display": "block",
                        "float": "left",
                        "background-color": "#004000"
                    })
                }
                if (i == 2) {
                    var width = parseInt($(this).html());
                    $(this).html("");
                    $(this).addClass($(self).attr("class")).css({
                        "height": "20px",
                        "width": width + "%",
                        "display": "block",
                        "float": "left",
                        "background-color": "#004080"
                    })
                }
                if (i == 3) {
                    var width = parseInt($(this).html());
                    $(this).html("");
                    $(this).addClass($(self).attr("class")).css({
                        "height": "20px",
                        "width": width + "%",
                        "display": "block",
                        "float": "left",
                        "background-color": "#ff0080"
                    })
                }
                if (i == 4) {
                    var width = parseInt($(this).html());
                    $(this).html("");
                    $(this).addClass($(self).attr("class")).css({
                        "height": "20px",
                        "width": width + "%",
                        "display": "block",
                        "float": "left",
                        "background-color": "#008080"
                    })
                }
                i = i + 1;
            });
        });                        
    </script>
</head>
<body marginwidth="1" marginheight="1" leftmargin="1" topmargin="5" rightmargin="1">
    <form id="form1" runat="server">
    <div class="box-vote">
        <table class="tbvote" align="center" cellpadding="3" cellspacing="1">
            <thead>
                <tr>
                    <th colspan="3" class="date">
                        <asp:Literal ID="txtDate" runat="server" />
                    </th>
                </tr>
                <tr>
                    <th colspan="3" class="title">
                        <asp:Literal ID="txtTitle" runat="server" />
                    </th>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater ID="rptVote" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td class="answer">
                                <%#Eval("ANSWER")%>
                            </td>
                            <td class="percent">
                                <div class="bar">
                                    <%#Eval("RATE")%>
                                </div>
                                <div class="val">
                                    <%#Convert.ToDecimal(Eval("RATE")).ToString("0.0") + "%"%>
                                </div>
                            </td>
                            <td class="number">
                                <%#Eval("NUMBER") + " phiếu"%>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </tbody>
            <tfoot>
                <tr>
                    <td class="total" colspan="3">
                        <asp:Literal ID="txtTotal" runat="server" />
                    </td>
                </tr>
                <%-- <tr class="close">
                    <td colspan="3">
                        <a>[Trở về]</a>
                    </td>
                </tr>--%>
            </tfoot>
        </table>
    </div>
    </form>
</body>
</html>
